<?php

/**
 * This file is part of the Codizer package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @copyright   Copyright (c) 2010 Advisa (http://www.advisa.fr)
 * @author      Codizer Core Team <team@codizer.org>
 * @package     Codizer
 */

class f_core_Cache
{		
	private static $defaultClass = "f_cache_CacheFile";
	
	/**
	 * Get singleton instance
	 *
	 * @return f_cache_AbstractCache
	 */
	public static function getInstance()
	{
		$config = f_loader_Config::getInstance()->getParameters("default");
		
		if(isset($config['cacheToUse']) && !is_null($config['cacheToUse']) && $config['cacheToUse'] != "")
		{
			$className = $config['cacheToUse'];
			return call_user_func($className."::getInstance");			
		}
		return call_user_func(self::$defaultClass."::getInstance");
	}
}